package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("容器初始化中");
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext("demo7");
        System.out.println("容器初始化完成");
        Person p1 = context.getBean(Person.class);
        p1.play();
        System.out.println("容器关闭中");
        context.close();
        System.out.println("容器关闭完成");
    }
}
